package com.mashibing.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mashibing.internalcommon.request.DriverUserWorkStatus;
import com.mashibing.internalcommon.dto.ResponseResult;
import com.mashibing.mapper.DriverUserWorkStatusMapper;
import com.mashibing.service.IDriverUserWorkStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 孟瑞达
 * @since 2025-06-18
 */
@Service
public class DriverUserWorkStatusServiceImpl implements IDriverUserWorkStatusService {

    @Autowired
    private DriverUserWorkStatusMapper mapper;
    @Override
    public ResponseResult updateStatus(DriverUserWorkStatus driverUserWorkStatus) {

        Long driverId = driverUserWorkStatus.getDriverId();
        QueryWrapper<DriverUserWorkStatus> wrapper = new QueryWrapper<>();
        wrapper.eq("driver_id",driverId);
        DriverUserWorkStatus status = mapper.selectOne(wrapper);

        status.setWorkStatus(driverUserWorkStatus.getWorkStatus());
        mapper.updateById(status);
        return ResponseResult.success();
    }



















}
